﻿using System;
using System.Xml;

namespace octalforty.Syndication.Core
{
    /// <summary>
    /// Defines a contract for a syndicator, which is used to transform the content of the
    /// <see cref="ISyndicationFeed"/> to the <see cref="XmlDocument"/> of
    /// the appropriate format.
    /// <seealso cref="ISyndicationFeed"/>.
    /// </summary>
    public interface ISyndicator
    {
        /// <summary>
        /// Syndicates <paramref name="syndicationFeed"/> and produces an <see cref="XmlDocument"/>
        /// of the appropriate format.
        /// </summary>
        /// <param name="syndicationFeed">The <see cref="ISyndicationFeed"/> to be syndicated.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// When <paramref name="syndicationFeed"/> is a <c>null</c> reference.
        /// </exception>
        /// <exception cref="SyndicationException">
        /// When the RSS specification has been violated (that is, when <paramref name="syndicationFeed"/>
        /// is missing required properties).
        /// </exception>
        XmlDocument Syndicate(ISyndicationFeed syndicationFeed);
    }
}
